let fs = require('fs');
let buf = '';

process.stdin.on('readable', function() {
    let chunk = process.stdin.read();
    if (chunk) buf += chunk.toString();
});

process.stdin.on('end', function() {
    let v = buf.split("\n").map((x)=>{return parseInt(x);});
    let f = (x1, y1, x2, y2)=>{
      return Math.sqrt(((x1-x2)**2) + ((y1-y2)**2));  
    };
    for (let n of v) {
        if (n === 0) break;
        for (let i = 0; i < n; ++i) {
            let s = "";
            for (let j = 0; j < n; ++j) {
                s += `${Math.min(i + 1, n - i, j + 1, n -j)} `;
            }
            console.log(s);
        }
        console.log()
    }
});